//5:求一个正整数 倒转后加上1024的结果.比如 12345倒转后是54321,加上1024，结果是55345.
package ZUOYE0421;

import java.util.Scanner;

public class 作业五 {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		System.out.println("输入一个数:");
		int num = in.nextInt();
		int b = 0;
		int a = 1;
		int sn = 0;
		for (;;) {
			a = a * 10;
			if (num % a == num) {
				a = a / 10;
				break;
			}
		}
		for (;;) {
			b = num % 10;
			num = num / 10;
			b = b * a;
			a = a / 10;
			sn = sn + b;
			if (num % 10 == num) {
				System.out.println("颠倒过来的值为：" + (num + sn));
				break;
			}
		}
		System.out.println("加上1024等于：" + (num + sn + 1024));
	}
}
